<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class CreateShopRoleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_role', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('shop_id')->comment('店铺id');
            $table->string('label')->comment("标签");
            $table->tinyInteger('role')->comment("店铺角色1店长2店员3模特");
            $table->unsignedInteger('hot_spot')->default(0)->comment("热度");
            $table->unsignedInteger('browse_num')->default(0)->comment("浏览量");
            $table->string('name')->comment("姓名");
            $table->string('phone')->comment("手机");
            $table->string('address')->default('')->comment("所在区域");
            $table->string('self_introduction')->default('')->comment("自我介绍");
            $table->string('img_url',2000)->default('')->comment("个人照片");
            $table->decimal('shop_profit','10','2')->default(0)->comment("店铺收益");
            $table->tinyInteger('status')->default('0')->comment("0竞选中1竞选成功2竞选失败3放弃");
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `shop_role` comment '店铺角色';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_role');
    }
}
